var main =(function () {
    var _getImg = function () {
        var urls = [];
        var temp = [];
        var i = 0,
            len = 0;

        temp = [{
            id: 'ground',
            url: 'ground.png'
        }, {
            id: 'wall',
            url: 'wall.png'
        }];

        for (i = 0, len = temp.length; i < len; i++) {
            urls.push({
                id: temp[i].id,
                url: bomberConfig.url_pre.SHOWMAP + temp[i].url
            });
        }

        return urls;
    };
    return {
        imgLoader: null,
        init: function () {
            var self = this;

            window.imgLoader = new YYC.Control.PreLoadImg(_getImg(), function (currentLoad, imgCount) {
                $('#progressbar').progressbar({
                    value: parseInt(currentLoad * 100 / imgCount, 10)
                }); //调用进度条插件
            }, YYC.Tool.func.bind(this, this.onload));
        },
        onload: function () {
            $('#progressBar').css('display', 'none');
            //this.context.drawImage(this.imgLoader.get('ground'), 0, 0);
            var game = new Game()
            game.init()
            game.run()

        },
    };
    window.main = main;
}());